class MyStack:
    def __init__(self):
        """
        Initialize your data structure here.
        """
        self.__list = []

    def push(self, x: int) -> None:
        """
        Push element x onto stack.
        """
        self.__list.append(x)

    def pop(self) -> int:
        """
        Removes the element on top of the stack and returns that element.
        """
        return self.__list.pop(-1)

    def top(self) -> int:
        """
        Get the top element.
        """
        return self.__list[0]

    def empty(self) -> bool:
        """
        Returns whether the stack is empty.
        """
        return len(self.__list) == 0


# Your MyStack object will be instantiated and called as such:
obj = MyStack()
print(obj.push(1))
print(obj.push(2))
print(obj.top())
print(obj.pop())
print(obj.empty())
